<template>
  <div class="shop-info-wrapper">
    <div class="logo_name">
      <img :src="shopInfo.shopLogo" alt="" />
      <span>{{ shopInfo.name }}</span>
    </div>
    <div class="sales_volume">
      <div class="left">
        <div>
          <div class="t20">{{ shopInfo.cSells }}</div>
          <div>总销量</div>
        </div>
        <div>
          <div class="t20">{{ shopInfo.cGoods }}</div>
          <div>全部宝贝</div>
        </div>
      </div>
      <div class="right">
        <div v-for="(item, index) in shopInfo.score" :key="index">
          <span>{{ item.name }}</span>
          <span class="defaultColor" :class='{ isBetter: item.isBetter}'>{{ item.score }}</span>
          <span class="tips" :class='{ isBetter2: item.isBetter }'>{{ item.isBetter ? "高" : "低" }}</span>
        </div>
      </div>
    </div>
    <div class="shop_input">进店逛逛</div>
  </div>
</template>

<script>
export default {
  name: "DetailShopInfo",
  props: {
    shopInfo: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style scoped>
.shop-info-wrapper {
  padding: 15px 10px;
}
.logo_name img {
  width: 50px;
  vertical-align: middle;
  border-radius: 50%;
  margin-right: 10px;
}
.sales_volume {
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;
  margin-top: 20px;
  padding: 10px 0;
}
.sales_volume > div {
  flex: 1;
  text-align: center;
  font-size: 14px;
  padding: 0  20px;
  box-sizing: border-box;
}
.sales_volume > div > div {
  margin-top: 0.5em;

}
.sales_volume .t20{
  font-size: 20px;
}
.sales_volume .left {
  display: flex;
  justify-content: space-between;
  border-right: 1px solid #f0f0f0;
  align-items: center;
}
.sales_volume .left > div > div{
  padding: 5px 0;
}
.sales_volume .right{
 
}
.sales_volume .right > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.defaultColor {
  color:green;
}
.defaultColor.isBetter {
  color:red
}
.tips {
  color: #fff;
  background-color: green;
}
.tips.isBetter2 {
 background-color: red;
}
.shop_input {
  text-align: center;
  width: 160px;
  background-color: #f0f0f0;
  border-radius: 6px;
  font-size: 12px;
  margin: 20px auto;
  padding: 10px 0;
}
</style>